package com.cc.pojo.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.cc.infrastructure.db.PerformanceDb;

import java.sql.Timestamp;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("前端传递参数")
public class PerformanceDto {


  /**
   *
   **/
  @ApiModelProperty("")
  private String id;
  /**
   * 通知书合同函id
   **/
  @ApiModelProperty("通知书合同函id")
  private String rnNoticeLetterId;
  /**
   *  主体类型（1：采购
   2：供应商
   )
   **/
  @ApiModelProperty("主体类型（1：采购
    2：供应商
  )
" )
  private String subjectType;
  /**
   * 主体id
   **/
  @ApiModelProperty("主体id")
  private String rnSubjectId;
  /**
   * 履约状态（1履约中 2完成）
   **/
  @ApiModelProperty("履约状态（1履约中 2完成）")
  private String state;
  /**
   * 履约情况
   **/
  @ApiModelProperty("履约情况")
  private String content;
  /**
   * 履约情况相关附件
   **/
  @ApiModelProperty("履约情况相关附件")
  private String file;
  /**
   * 创建时间
   **/
  @ApiModelProperty("创建时间")
  private Timestamp ctime;
  /**
   * 更新时间
   **/
  @ApiModelProperty("更新时间")
  private Timestamp mtime;

  public static PerformanceDb convertPerformanceDbByPerformanceDto(PerformanceDto performanceDto) {
    PerformanceDb performancedb = new PerformanceDb();
    performancedb.setId(performanceDto.getId());
    performancedb.setRnNoticeLetterId(performanceDto.getRnNoticeLetterId());
    performancedb.setSubjectType(performanceDto.getSubjectType());
    performancedb.setRnSubjectId(performanceDto.getRnSubjectId());
    performancedb.setState(performanceDto.getState());
    performancedb.setContent(performanceDto.getContent());
    performancedb.setFile(performanceDto.getFile());
    performancedb.setCtime(performanceDto.getCtime());
    performancedb.setMtime(performanceDto.getMtime());
    return performancedb;
  }
}